package com.itheima.day02.ZuoYe.ZuoYe_4;

public class Breeder {
    public void breed(Animals a){
        System.out.println("Breeding...");
        if(a instanceof Dog){
            a.drink();
            a.eat();
            ((Dog) a).swim();
        }else if(a instanceof Frog){
            a.eat();
            a.drink();
            ((Frog) a).swim();
        }else{
            a.eat();
            a.drink();
        }
    }
    public static void Swim(swimgame a) {
        if(a instanceof swimgame){
            a.swim();
        }else{
            System.out.println("无法参赛");

        }
    }
}
